<?php
require_once("./include/db_info.inc.php");
require_once("./bm-header.php");
require_once("./include/funcs.php");
	$cache_time=10;
	$OJ_CACHE_SHARE=false;
	require_once('./include/cache_start.php');
///////////////////////////MAIN	
	
	$view_news="";
	$sql=	"SELECT * "
			."FROM `news` "
			."WHERE `defunct`!='Y'"
			."ORDER BY `importance` ASC,`time` DESC "
			."LIMIT 5";
	$result=mysql_query($sql);//mysql_escape_string($sql));
	if (!$result){
		$view_news= "<h3>No News Now!</h3>";
		$view_news.= mysql_error();
	}else{
		$view_news.= "<table width=96%>";
		
		while ($row=mysql_fetch_object($result)){
			$view_news.= "<tr><td><td><big><b>".$row->title."</b></big>-<small>[".$row->user_id."]</small></tr>";
			$view_news.= "<tr><td><td>".$row->content."</tr>";
		}
		mysql_free_result($result);
		$view_news.= "<tr><td width=20%><td>This <a href=http://cm.baylor.edu/welcome.icpc>ACM/ICPC</a> OnlineJudge is a GPL product from <a href=http://code.google.com/p/hustoj>hustoj</a></tr>";
		$view_news.= "</table>";
	}
$view_apc_info="";

if(function_exists('apc_cache_info')){
	 $_apc_cache_info = apc_cache_info(); 
		$view_apc_info =_apc_cache_info;
}
?>
<div>
	<form action="register.php" method="post">
	<br><br>
	<center><table>
		<tr><td colspan=2 height=40 width=500>&nbsp;&nbsp;&nbsp;<?php echo 'Register Information'?></td></tr>
		<tr><td width=25%><?php echo 'User ID'?>:</td>
			<td width=75%><input name="user_id" size=20 type=text>*</td>
		</tr>
		<tr><td><?php echo 'NickName'?>:</td>
			<td><input name="nick" size=50 type=text></td>
		</tr>
		<tr><td><?php echo 'Password'?>:</td>
			<td><input name="password" size=20 type=password>*</td>
		</tr>
		<tr><td><?php echo 'Repeat Password'?>:</td>
			<td><input name="rptpassword" size=20 type=password>*</td>
		</tr>
		<tr><td><?php echo 'School'?>:</td>
			<td><input name="school" size=30 type=text></td>
		</tr>
		<tr><td><?php echo 'Email'?>:</td>
			<td><input name="email" size=30 type=text></td>
		</tr>
		<?php if($BM_VCODE){?>
		<tr><td><?php echo 'Verification Code'; ?>:</td>
			<td><input name="vcode" size=4 type=text><img alt="click to change" src="vcode.php" onClick="this.src='vcode.php#'+Math.random()">*</td>
		</tr>
		<?php }?>
		<tr><td></td>
			<td><input value="Submit" name="submit" type="submit">
				&nbsp; &nbsp;
				<input value="Reset" name="reset" type="reset"></td>
		</tr>
	</table></center>
	<br><br>
</form>
</div>
<?php
require_once("bm-footer.php");
if(file_exists('./include/cache_end.php'))
	require_once('./include/cache_end.php');
?>
